package com.rm.zeyou.mapper;

import com.rm.zeyou.entity.CityVote;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 城市投票表 Mapper 接口
 * </p>
 *
 * @author YanYang
 * @since 2025-03-14 17:20:22
 */
@Mapper
public interface CityVoteMapper extends BaseMapper<CityVote> {

    @Select("select * from t_city_vote where city_name = #{address}")
    CityVote selectOneCity(@Param("address") String address);

    @Update("update t_city_vote set vote_count = vote_count +1 where id = #{id}")
    Integer addCount(@Param("id") Long id);
}
